import {post} from '@/request/http'
import store from '@/store'

//查询
export const getTmAttendanceListA = ({
  wdcTime,
  trkType = '',
  trkNo = '',
  PageIndex,
  PageSize,
}) => {
  return post('/FTKJWLHYPT/transoprt/getTmAttendanceList', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          wdcTime,
          trkType,
          trkNo,
          wdcFltId: store.state.user.FLT_UUID_DX_H,
        }
      },
      Orderby: {},
      PageIndex: {
        FTKJWLHYPT: PageIndex
      },
      PageSize: {
        FTKJWLHYPT: PageSize
      }
    }
  })
}


//查询
export const getWayBillInfoList = ({
  trkNo,
  drvName,
  start,
  end,
  fltUuid,
  contractNo
}) => {
  return post('/FTKJWLHYPT/transoprt/getWayBillInfoList', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          trkNo,
          drvName,
          start,
          end,
          fltUuid,
          contractNo
        }
      }
    }
  })
}

//新增保存

export const addOrEditTmAttendancecar = ({
  wdcId,
  wdcTrkId,
  wdcDvrId,

  wdcTime,
  wdcRemark,
}) => {
  return post('/FTKJWLHYPT/transoprt/addOrEditTmAttendancecar', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          wdcId,
          wdcTrkId,
          wdcDvrId,
          wdcFltId: store.state.user.FLT_UUID_DX_H,
          wdcTime,
          wdcStatus: '',
          wdcInsertuser: store.state.user.USR_CODE_DX_H,
          wdcLstupduser: store.state.user.USR_CODE_DX_H,
          wdcRemark,
          wdcX: '',
          wdcY: '',
          wdcLogindate: '',
          wdcAddress: ''
        }
      }
    }
  })
}

//运力发布（一键发布）
export const addAllTmAttendancecar = ({wdcTime}) => {
  return post('/FTKJWLHYPT/transoprt/addAllTmAttendancecar', {

    Data: {
      Parameters: {
        FTKJWLHYPT: {
          wdcFltId: store.state.user.FLT_UUID_DX_H,
          wdcTime,
          wdcInsertuser: store.state.user.USR_CODE_DX_H,
        }
      }
    }
  })
}

//运力删除
export const delTmAttendancecar = ({
  wdcTime,
  wdcTrkId
}) => {
  return post('/FTKJWLHYPT/transoprt/delTmAttendancecar', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          wdcFltId: store.state.user.FLT_UUID_DX_H,
          wdcTime,
          wdcTrkId
        }
      }
    }
  })
}

//轨迹接口
export const getWayMap = ({
  vcln,
  btime,
  etime
}) => {
  return post('/FTKJWLHYPT/transoprt/driverline', {
    Data: {
      Parameters: {
          FTKJWLHYPT: {
            vcln,
            btime,
            etime
        }
      }
    }
  })
}

//设备轨迹接口
export const equipmentMap = ({
  vcln,
  btime,
  etime,
  terminalNo
}) => {
  return post('/FTKJWLHYPT/transoprt/driverlinebyterminalNo', {
    Data: {
      Parameters: {
          FTKJWLHYPT: {
            vcln,
            btime,
            etime,
            terminalNo
        }
      }
    }
  })
}

//查询该企业下所有车辆
export const selectAllTruck = ({
  
}) => {
  return post('/FTKJWLHYPT/transoprt/selectAllTrucks', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          fltUuid: store.state.user.FLT_UUID_DX_H
        }
      }
    }
  })
}